package com.example.mobile2121606109ycg0511homework;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class user_date_activity extends AppCompatActivity {

    private TextView tvMainUserName;
    private TextView tvMainPhone;
    private TextView tvtMainMail;
    private TextView tvMainYears;
    private Button btnMainConfirm;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_user_date);
        initView();

        Intent intent = getIntent();
        Bundle bundle = intent.getExtras();
        tvMainUserName.setText(bundle.getString("userName"));
        tvMainPhone.setText(bundle.getString("phone"));
        tvtMainMail.setText(bundle.getString("mail"));
        tvMainYears.setText(bundle.getString("years"));
        btnMainConfirm.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(user_date_activity.this,MainActivity.class);
                startActivity(intent);
            }
        });
    }

    private void initView() {
        tvMainUserName = (TextView) findViewById(R.id.tvMainUserName);
        tvMainPhone = (TextView) findViewById(R.id.tvMainPhone);
        tvtMainMail = (TextView) findViewById(R.id.tvtMainMail);
        tvMainYears = (TextView) findViewById(R.id.tvMainYears);
        btnMainConfirm = (Button) findViewById(R.id.btnMainConfirm);
    }
}